@TITLE Starting...
@SET Sz="%ProgramFiles%\7-zip\7z.exe"
@IF NOT EXIST %Sz% (
@ECHO Could not find 7-Zip which is required to generate archives.
@ECHO Please install it or modify this batch file with the correct path.
@ECHO.
@PAUSE
GOTO :eof
)

@IF NOT "%1"=="/Q" CALL "Compile.bat" /Q
TITLE Packing...
SET Szp=%Sz% a -tzip
SET Szs=-mx=9
SET doc=doc
SET output=rsbot_000.zip
SET Szpr=%Szp% "%output%"

IF EXIST "%output%" DEL /F /Q "%output%"
%Szpr% * -r -x!*.svn -x!*.class -x!logs\* "-x!%doc%\*" -x!doc -x!Settings\Accounts\* "-x!Tests\" "-x!Package.bat" -x!*.sh %Szs%
%Szpr% -r Bot\rsbot\bash\Compiler.class Bot\com\speljohan\rsbot\logging\*.class Bot\com\speljohan\rsbot\plugin\PermissionUCL.class %Szs%

IF EXIST "%doc%" (
CALL "Documentation.bat"
TITLE Packing Documentation...
SET outputdoc="%doc%_000.zip"
IF EXIST %outputdoc% DEL /F /Q %outputdoc%
%Szp% %outputdoc% "%doc%\*" -r -x!.svn %Szs%
)

TITLE Completed